//
//  CountDownCell.swift
//  SHCountDown
//
//  Created by jiaxing liu on 2019/1/25.
//  Copyright © 2019 jiaxing liu. All rights reserved.
//

import UIKit

class CountDownCell: UITableViewCell {

    lazy var dateView: SHCountDownView = {
        let dateView = SHCountDownView(frame: .zero, isStartTimer: false)
        return dateView
    }()
    
    static let  tableViewCellIdentifier = "CountDownCell"
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        dateView.frame = CGRect(x: mediateX(150), y: mediateY(30), width: 150, height: 30)
    }
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
       selectionStyle = .none
        setUpUI()
    }
    
    
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setUpUI() {
        contentView.addSubview(dateView)
        contentView.backgroundColor = UIColor.white
    }
    deinit {
        print("view deinit")
    }
}
